#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<string> tmp;
    string s1;
    vector<string> v = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
    void _letterCombinations(int pos, string digits)
    {
        if (pos == digits.size())
        {
            tmp.push_back(s1);
            return;
        }
        int num = digits[pos] - '0';
        for (int i = 0; i < v[num].size(); ++i)
        {
            s1.push_back(v[num][i]);
            _letterCombinations(pos + 1, digits);
            s1.pop_back();
        }
    }
    vector<string> letterCombinations(string digits)
    {
        if (digits.size() == 0)
            return tmp;
        _letterCombinations(0, digits);
        return tmp;
    }
};

